<!DOCTYPE html>
<html lang="en" xmlns:th="https://www.thymeleaf.org">
	<head>
		<meta charset="utf-8">
		<title>Login Page</title>
		<!-- 样 式 文 件 -->
		<link rel="stylesheet" href="component/pear/css/pear.css" />
		<link rel="stylesheet" href="admin/css/other/login.css" />
	</head>
    <!-- 代 码 结 构 -->
	<body background="/admin/images/background.svg" style="background-size: cover;">
		<form class="layui-form" action="/login" method="post">
			<div class="layui-form-item">
				<img class="logo" src="/admin/images/cook.jpg" style="border-radius: 75%" />
				<div class="title">你饿么在线订餐</div>
				<div class="desc">

				</div>
			</div>
			<div class="layui-form-item">
				<input placeholder="账 户" name="username" lay-verify="required" hover class="layui-input"  />
			</div>
			<div class="layui-form-item">
				<input placeholder="密 码 " type="password" name="password" lay-verify="required" hover class="layui-input"  />
			</div>
			<div class="layui-form-item">
				<input placeholder="验证码 : "  hover  name="captcha"  lay-verify="required" class="code layui-input layui-input-inline"  />
				<img th:src="@{/createVerifyCode}" onclick="refresh()" id="captcha" class="codeImage">
			</div>
			<div class="layui-form-item">
				<button type="submit" class="pear-btn pear-btn-success login" lay-submit lay-filter="login">
					登 入
				</button>
			</div>
			<div class="layui-form-item"  >
				<div style="text-align: right">
					<span style="color: #423939;">没有帐户? <a onclick="register()" href="javascript:;" style="color: salmon">点我注册</a></span>
				</div>

			</div>
			<div class="layui-form-item" style="text-align: center">
				<h3><span th:text="${msg}" style="color: red"></span></h3>
			</div>



		</form>
		<!-- 资 源 引 入 -->
		<script src="component/layui/layui.js"></script>
		<script src="component/pear/pear.js"></script>
		<script>


			function refresh() {
				document.getElementById("captcha").src = "createVerifyCode?"+Math.random();
			}


			function register(){
				layer.open({
					type: 2,
					title: '注册用户',
					shade: 0.1,
					area: ['500px', '400px'],
					content: '/user/registerView'
				});
			}


		</script>
	</body>
</html>
